I prefer to write a managed shell in C ++ / CLI (formerly Managed C ++), since it makes it much easier to explicitly do what you want with managed / unmanaged compatibility on the C ++ side, and your C # is not polluted with P / Invoke style code.
Edit I just noticed your comment "However, I will call this function with C # and I do not believe that I can export a class, just functions or variables."
This is not entirely true - C # can import complete classes from an assembly generated from C ++ / CLI code.
source share