On Windows 10 start VS2015 as Administrator. This is important so that VS2015 can perform the COM registration during the build process for the C# Class Library project.
Class Library Project Properties - 32-bit build with COM registration
In this example the C# namespace is CSharpServer and the class is Hello. When this project is built by VS2015 it will perform COM registration and create a ProgId of CSharpServer.Hello in the registry under HKCR. For example,
The GUID in the example is the CLSID that VS2015s COM registration will create in the 32-bit view of the registry under the WOW6432Node subkey of HKCR. For example, this is the 32-bit registration of the CLSID key in the registry -
Note the WOW6432Node subkey in the path above
Run script from 64-bit Command prompt. Error is expected for 32-bit server.
Run script from 32-bit Command prompt. Successful execution results.