Many years ago, I recall using a compile time option for tracing the calls to AddRef() and Release(), used to trace the lifetime of a COM object.
Does this still exist in VS2008?
I am working on some legacy code that has issues with its handling of COM objects.
In case if you are using ATL, you may output this information by defining _ATL_DEBUG_INTERFACES.
Otherwise one should manually put the tracing code in the AddRef/Release method implementations or implement an ATL-like wrapper which will implement IUnknown interface with built-in logging functionality.
You may take a look on the implementation of the CComObjectRootBase class.