There was a similar problem in this forum or maybe in the VC General forum within the past month, but I forget what the subject was and such. I think there was a problem with a STL class that allocated memory in a DLL and freed memory in the application.
I know that there have been problems in the past with memory allocations/deallocations across a DLL and the application. I am not sure of the problem currently. I assume that any problems that currently exist is documented somewhere, but for VC 6, it was only described in a KB article. I posted a link to the KB article in the prior thread, but it was ignored, so I assume it is not currently relevant.
Are you building your UI-application using static libraries If so, then try dynamic libraries.