I wrote an application which allows people to contribute plugins to extend the functionality. Such plugins are deployed as DLL files, which the framework picks up during run
If the DLL code is responsible for allocating objects, it should also be responsible for freeing them. I think your problem is more with the reference counting and the "delete this". If you want to go that route, why not simply implemnt the objects as COM objects? This is after all one of the main problems that COM was designed to solve!