I'm a bit confused. Are you accessing files on a windows machine form your ubuntu box, because in that case, you're not using samba. You're using the kernel cifs or smbfs modules. From the error your getting, it looks like this is the case. What I guess is happening is that when you shutdown, the network is getting disabled before you unmount all the network file systems. So when it gets to the unmounting bit in the shutdown process it fails, and the shutdown hangs.
Not sure how to fix it in Ubuntu (I don't suppose it's supposed to work like this, something must've got messed up somewhere), but and ugly hack way to do it would be to put an 'unmount' script into the /etc/rc.d/rc.6 directory, and have it numbered to run before the network switches off.
Found
this on the Ubuntu forums. Looks like your not the only one having this problem. It's the script you'd need to do what I said above.