Check out the avast help file (right click the avast icon, select Start avast! Antivirus, Menu, Help or press F1), Resident Protection, Web Shield, but basically it monitors the traffic from the web to your system and if infected content is found it should alarm and effectively block it from being downloaded and stop it arriving on your HDD.
Comodo should do the job of checking outbound connections, but you have to read what it is telling you. You have to have some idea that it isn't something you are doing at that time that is trying to connect and not just say Yes to all questions or say No to all questions.