I'm surprised as well, I have AVG on a system and was unable to reproduce the issue with a fresh install of code::blocks. Can you post the code that was flagged as a virus? If this is an AVG issue it should be reproduced so a bug report can be filed.
AVG can damage seriously your system because it destroys the entire document which is suspicious or which has a virus. That document might be a .dll or something like this. In your place, I would reinstalled the operating system.
What version of AVG do you use and was it updated? I don't know if you can really say AVG is the problem unless it can be reproduced on a different system, I'm inclined to think it its something else specific to your system.