I have never made it to work and don't care much :).
Use libavcodec (for Mkv) or
Thomas Waldvogel's demultiplexer together with its decoder (for Ogm).
The only reason why you wouldn't want to use ffdshow is because its big and introduces a delay while loading. This does not matter for movies, only for OGG Vorbis music.