K8055 - Trying to interface to a model railway setup

I’m a model railway enthusiast and I’ve just interfaced the JAVA JMRI software to my NCE train controller. It all works well. I now want to have stand-alone infrared sensors to detect when a train is present and I thought the K8055 would do the job well. The IR sensors connect to the K8055 as digitial inputs. It does handle the hardware but the software for the K8055 is written in Visual Basic, Borland C and Delphi. I have to try to interface this with Java Script. In other words get the K8055 to talk to the Java Script code. Anyone have any ideas on how I can get around this ?