i'm not going to do it for you, but search google for the little black book of computer viruses, i'm sure you can still download it from somewhere. it'll give you the best insight of what it takes to write a good virus. plus all the examples it gives are old and well known to antivirus software, so you can't do much damange with them.

one word of warning...don't compile them on your main box, they'll spread like wildfire on your machine if you're not careful.