Yes, and that's quite complicated...
First, there is no way of setting a password on a device driver.(except if you write the device driver yourself, or you install a filter driver on top of the USB driver or disk driver)
Second, editing the local policies or group policies programmatically is not for the faint of heart...
http://www.codeproject.com/Questions/74596/programming-in-gpedit-msc.aspx[
^]