I'm not sure if this is any help to you, but there is an AVI tutorial on nehe.gamedev.net, but in OpenGL...

http://nehe.gamedev.net/data/lessons....asp?lesson=35

You might be able to get what you need from that tutorial.