Marshal.ReleaseComObject provides a way to immediately delete references to this COM object because it is consumed inside managed code (since it frees the underlying IUnknown from the RCW that holds it).
As Hans notes, the overall right course is to simply destroy your object so that the CLR and GC can destroy COM objects at the right time.
However, in situations where you need an immediate action (the COM object contains expensive / limited resources, or perhaps during shutdown, where the sequence is very complex), calling ReleaseComObject may be correct.
Martyn
source share