Here is a simple sketch I wrote that allows you to read/write any digital/analog pin. It works by sending simple commands via serial port from the computer to the Arduino board, which replies back on the serial port. Currently I use it by just typing in the commands manually, but somebody could write a program that automates this on the computer side. This could possibly be morphed into something like you are talking about. Feel free to steal the code and hack on it!