They're called Ferrite Cores and they reduce the amount of electromagnetic interference. They're most common on USB leads from digital cameras as interference can cause data loss and therefore, loss of image quality while transferring the image to your computer.