COM exe out-of-process servers in particular are hard to write, but Microsoft has created a COM + Component service to facilitate this.
It contains many services, but here we are interested in an application service that allows you to host in-process servers (DLLs) on a surrogate node outside the process.
It's pretty simple, just write a standard ATL DLL (or use any other language / frame that you like). I recommend using automation types for the interface, so you do not need special proxies, for example, with the IDL interface defined as follows:
interface ISharedMap : IDispatch{ [id(1)] HRESULT PutData([in] BSTR key, [in] VARIANT value); [id(2)] HRESULT GetData([in] BSTR key, [out, retval] VARIANT *pValue); };
Then create a new COM + application as described here: Create COM + applications and declare it as a server application. This is what you should see when this is done:

Now your DLL will automatically be placed in a certain process (the famous dllhost.exe ), which will be launched as soon as the clients try to connect. By default, the same process will be used for different COM clients outside the process. It will shut down after a while, but you can configure the COM + application in various ways, for example, using the "Leave to work when there is no free time" command:

Now you can use the memory cache for cross-processes for all COM clients that you like, for example, from simple javascript.js code:
var map = new ActiveXObject("SharedMap"); map.PutData("mykey", "mydata") var data = map.GetData("mykey")
Note: the cache implementation is left to the reader, but it can reuse another of the COM + services: COM + Shared Property Manager