If you just want the serial number for the logical parition, you can use this API:
For the serial id of the physical disk, most people use WMI. There's a CP article that shows how to do this without WMI:
Get Physical HDD Serial Number without WMI
Make sure you read the comments on that article's forum - it may require admin rights on Vista/Windows 7.