Each copy of Windows 7 requires a unique activation code. Since the activation code that came with the install disk you have has been used by your friend, you will not be able to use the same activation code to activate windows on your computer. You can install Windows 7 from the same install disk, however, if you want to use the copy of windows for more than 30 days you will be required by microsoft to purchase a new activation code at the retail price for Windows 7.
Did your friend install his copy of windows from your CD without your permission? If so, then he owes you about $120 which is what it will cost you to get a new license for Windows 7.