In the palyground there's some examples of doing that :
http://www.arduino.cc/playground/Interfacing/MaxMSP