"Example Native Method Declaration"

static const wchar_t* GetHelloString() {
	return L"Hello";
}

typedef const wchar_t* (*helloStrPtr)(void);

extern "C" __declspec(dllexport) void GetFuncPtr(helloStrPtr* outFuncPtr) {
	*outFuncPtr = &GetHelloString;
}


Code snippet taken from "Complete C# Quick Reference - C# 9".