Well, yes, COM supports remote procedure calls to an out-of-process COM server. You make the call from the client, it runs in another process as though it was called inside that process. A code snippet doesn't make much sense because it looks exactly like a regular function call.
There's a fair amount of plumbing and configuration you have to take care of to make that work. You typically need a proxy/stub DLL that helps to marshal the arguments of the function call. They are normally auto-generated from the IDL you write that describes the interfaces. If the arguments you pass are 'unusual' then you may need to write a custom marshaller. That's usually easily avoided by not passing opaque pointers or variable sized chunks of data.
Visual Studio can get a lot of that stuff done automatically, ATL is very helpful. Doing something wrong unintentionally is definitely a lot harder to trouble-shoot. Expect several months to get up to speed on this if you've never done it before. Getting good learning material can be difficult, this is getting obsolete. This kind of stuff is done in managed environments these days. Much easier to auto-generate the required proxies.