I was running a C++ COM DLL from a Win Forms C# project on a 64-bit OS. I changed the Win Forms C# project to be x86, re-ran, and it worked. To do this:-
- Right-click the .NET project, and choose Properties
- Select the Build tab
- Set Platform target to
x86
- Recompile, and re-run
Concept of changing bitness from George J's answer