In this example, provided sample how to implemet ComWrappers which provide implementation for the IMallocSpy
Run following in x64 Native Tools for Visual Studio 2019
cd CoMallocNativeAot
dotnet publish -c Release -r win-x64
bin\x64\Release\net5.0-windows\win-x64\publish\CoMallocNativeAot.exe