I think your trivialising the process of creating a device driver, however I have the following suggestion.
Check Apples Developer site for the 'USBUPSMonitor' sample code, found here:
http://developer.apple.com/samplecod...UPSMonitor.htm
Download, read instructions and compile - providing your power device is USB Power Class-compatible you might be lucky and find it works with your power device. On the other hand it might not work - in this case you have a source code starting point to work from demonstrating how to use daemons, usb interaction, shutting down system etc.
Perhaps there is an open-source unix driver for your particular power device, search sourceforge.net to find out - this would help you.
I'd also suggest you read through the info on apple's developer site about USB devices and device drivers and perhaps buy a book or two.