Not very Easily!
I suggest you look at some of Dale Seeley's questions, as i know he was trying to do the same thing. I answered a few of his questions.
http://www.codeproject.com/script/Answers/MemberPosts.aspx?tab=questions&mid=7475686[
^]
Look at scanning, hashing, heuristics, nearly all his questions relate to his virus scanner one way or another.
The answer below has a link to a Symantec document on Heuristics, which makes for a good read and also shows how much work is required.
Need Advice About Heuristics? " Please Advise"[
^]
My ultimate advice would be, leave it to the professionals, they have been in the game along time and have massive teams working on Virus/Malware/Security...........