Today I learned a new way to use functionality from a DotNet assembly from a native Windows application.
Because I found the necessary information rather scattered over the internets, and it isn't explicitly mentioned in the Microsoft documentation, I publish a little demo solution.
http://springelkamp.nl/Files/Interop.zip
The standard documented way to call a DotNet class from native Windows code is to wrap the DotNet class in a COM object, and then manipulate the COM object from your native code.
I don't particularly like working with COM (my Windows experience come more from Delphi than from Visual Basic, so I could mostly avoid it) because of the installation and versioning issues.
The published demo uses a C++/CLI wrapper that exposes DotNet Methods as classic DLL exports.
In C++ compiled with the /clr option (using the MS C++ compiler) managed and native code can be mixed, using the IJW technology ('It Just Works').
In this way constructing a wrapper becomes quite trivial.
Now, if somebody would write a code generator to produce such a wrapper automatically....