First of all, make sure you really want it. In most cases, pure .NET FCL can be used to solve your problems. If you asked about your ultimate goals, you could have a chance to get some good ideas.
What you need is called P/Invoke. Please see:
http://en.wikipedia.org/wiki/P/Invoke[
^],
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcmg_PlatformInvocationServices.asp[
^].
This CodeProject article can also be useful:
Essential P/Invoke[
^].
You should understand that your code for .NET, if written in a compatible platform-independent manner based on the CLR standard, can be executed on many other platforms, such as Linux, Max OS X, and more,
without recompilation, mostly via Mono. Using P/Invoke will kill such platform compatibility.
—SA