As I understand it I can use reverse P/Invoke to call C# from C++. Reverse P/Invoke is simply a case of:
With ilasm 2.0 you need less code because it can generate most of the gunk by itself. Only the .export directive is really needed now.
// unmexports.il
// Compile with : ilasm unmexports.il /dll
.assembly extern mscorlib { auto }
.assembly UnmExports {}
.module UnmExports.dll
.method public static void foo()
{
.export [1] as foo
ldstr "Hello from managed world"
call void [mscorlib]System.Console::WriteLine(string)
ret
}