Associating a particular file type with a particular application is, as Blake said, done via the registry manually.
It can also be done programatically and
this[
^] thread on MSDN has some examples. I would have been more specific but you do not say which OS you need it for.