Gianmaria,
You should use the classes in the System.Management namespace to run a
WMI query on the system. There is one instance of the Win32_Processor class
for each processor on a machine. You should be able to use the DeviceID
property here to get the unique id of the processor. For the hard drives,
you should be able to get all instances of the Win32_DiskDrive class and
then use the DeviceID property on that class.
Hope this helps.