That's like asking how to make an operating system. Antivirus applications aren't trivial, so your best bet would be to find an ... project and study how it works. And nobody will give you source code because it would be hideously long.
As deceptikon stated, it will be hidously long... There are so many (good) and FREE packages out there. If you want to just study it, rather get a free and open source (as was suggested) and go with that. I personally would choose a different subject to hone my skills on. :)
Please close this thread by marking as solved at the bottom please, thanx.