Once you have installed both VirtualDub and the DivX Codecs and also perhaps a MP3 codec like Lame or Radium, if you wish to encode to the MPEG-3 format. Then, start VirtualDub, and do the following :
File menu => Open video file - the orginal un-encoded AVI file
In the "Video" menu, select "compression", and set it to the DivX Codec (also try configuring the Codec settings, such as keyframes and bitrate - have a look on this page for more information).
Still in the Video menu, select the option "Full processing mode".
If your orginal AVI had audio, please find out what frequency it is (right click on the file and select "properties", it should be listed in the "Details" section).
Still in the Audio menu, select the option "AVI audio"
Go to the Audio menu and select "compression", and set it to MPEG-3 with frequency matching that of your original AVI file, and also bitrate to at least 96. You may need to turn on the "Show all format" option to see all available options.
Still in the Audio menu, select the option "Full processing mode"
Lastly, go to the file menu and select "Save AVI", and choose a name for the file (make it different to the name of the original AVI), and in a few minutes (depending on the size of your original AVI file), you'll have a perfect DivX AVI file.