I need to implement a Mac OS X application. In my application I need to do two things:
Depending on the type of device you might able to set an application to open automatically via the iPhoto/Image Capture preferences. That will work only for a limited class of devices, for an application already present on the computer and will require changing the preferences on the computer manually.
In general, there's no way to automatically run arbitrary applications on CD/DVD/USB insert because it's a security problem.