"UnmanagedCallersOnly Example, C++ Side"

typedef int (*getIntPtr)(void);

extern "C" __declspec(dllexport) void InvokeFuncPtr(getIntPtr funcPtr) {
	std::wcout << funcPtr();
}


Code snippet taken from "Two Decades of C#: A Reference - C# 9".