If anybody is interested, I have found a couple of examples of this in C#. I'm going to try (with very limited knowledge of C# at the moment!) to create some sort of DLL which will handle these functions.