SAP - DI API: Retrieving the COM class factory for component with CLSID

Right click on the Solution and click on Compile --> Advanced Compile Options... button and in the Advanced Compiler Settings, set the "Target CPU" to "x86" and then Re-build your solution then try.