// Define the istream which stores marshalled interface pointer
IStream* iStream;
// Marshal the pointer in one thread
hResult = CoMarshalInterThreadInterfaceInStream (__uuidof(InterfaceClass), spInterfacePointer, &iStream);
// Unmarshal and get the interface pointer in another thread
hResult = CoGetInterfaceAndReleaseStream (iStream, __uuidof(InterfaceClass), (void**)&spInterfacePointer);