.NET Framework presents several methods of hosting managed runtime. One can use mscoree.dll's CorBindToRuntime (https://msdn.microsoft.com/library/ms231419(v=vs.110).aspx) to get handle of AppDomain via GetDefaultDomain/CreateDomain, and then load assemblies, instantiate objects and call mscorlib interop objects' methods.
This method is now declared obsolete, but newer interface based on CLRCreateInstance (https://msdn.microsoft.com/library/ms164408(v=vs.110).aspx) provides similar capabilities. At some point one gets access to COM-compatible AppDomain object and can communicate with managed code.
However, CoreCLR (https://www.microsoft.com/net, https://github.com/dotnet/coreclr) is missing mscoree.dll. A hosting method that allows to execute a piece of CoreCLR managed code is described in
http://www.fancy-development.net/hosting-net-core-clr-in-your-own-process
But ICLRRuntimeHost/ICLRRuntimeHost2 interfaces do not present any way to pass data to called managed function, neither can I get the results of the computation. So, the method is only applicable if the code is called for the side effects.
What is the way to pass data to and from managed code under CoreCLR?