HRESULT hr; CComObject<MyClass>* pMyClass = NULL; hr = CComObject<MyClass>::CreateInstance(&pMyClass); ...........