You must call CoInitialize or CoInitializeEx before you call any other COM API, including of course CoCreateInstance.