It will be platform specific, so you need to write wrappers for each system you're supporting it on.

Under Windows, you need to write what's known as a "Shell Extension". It's a separate library which is compiled as a COM compliant dll which is 'registered'. You could do it the painful way through C++ using ATL to simplify things, or the best way I've found is with a third party product called EZShellExtensions.NET from http://www.ssware.com/ezshell/ezshell.htm
This framework simplifies the process of creating the extension, but if you just want to write your own, then search for Context menu shell extensions

I think the EZShellExtensions.NET framework is really good, at the very least, it's worth getting the trial just to see the generic API they've produced as inspiration for you own.

I hope this helps.

Steve York