The Media Foundation SimplePlay sample guestgulkan mentions is one of a number of ways.
SimplePlay Sample (Windows)
But note that while the MFPlay API it uses only came in with Windows 7, it's already marked as deprecated. SimplePlay is, however, easier to follow that the latest, preferred (by Microsoft) approach which can be found here:
Media Session Playback Example
Another Media Foundation player, which works on Windows Vista and newer is this:
MFPlayer Sample (Windows)
But an alternative approach is to embed (or just launch) a player. e.g. the Window Media Player control or possibly VLC Player (I've only played with the latter.)
Your opening post doesn't specify how
you want to play the AVI file?
PS The same set of documentation also explains the older DirectShow approach (about since the mid-90s, but which is still used by apps that need to support older versions of Windows) and, much deeper down, the ancient Video for Windows approach (which started off life in the Win16 days).