when you connect a usb pendrive to your linux box you should see activity in the file /var/log/messages.
Try to do the follwing command
sudo tail -f /var/log/messages
connect the usb drive and see what happens.
Or you can give as root the command "dmesg".
In what language are you developing? If you are using the C language you could find something useful here
Hope this will help