Control an animation via scripting with another program/code

Hi to all. I’ve made an animation which is driven by some key sensors. What I would like to know is if there’s some way to have it prepared to be integrated with other code. I just want to change the control of the animations via keyboard to have them controlled maybe by the value of some variables or properties that could be accesible from another program/code.
I’ve tried the ActiveX control in visual studio and done it by sending the player the key values that it expects directly from code but I don’t think that’s a good approach.
I know using another engine like Ogre could be the solution but I would like something simple.
Is it possible to do so with an script? Where could I find some info? Any directions will be wellcomed. Many thanks.

not sure, but maybe this can help you a bit ?

http://biphome.spray.se/millfield/