IntPtrで渡された関数ポインタをDelegateに変換。
using System;
using System.Runtime.InteropServices;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
delegate int func_i_i(int v);
int CallFunc(IntPtr fp)
{
func_i_i p;
p = (func_i_i)Marshal.GetDelegateForFunctionPointer(fp, typeof(func_i_i));
return p(1);
}