Blatantly snarfed from a post by Nicholas Riley on the macosx-admin mailing-list:
/Developer/Tools/SetFile -c <creator code>.
To find (an app's) creator code the simplest method I know of is to use launch (or use 'fink install launch' if you have Fink). It gives you a result like this:
% launch -f /System/Library/CoreServices/Help\ Viewer.app /System/Library/CoreServices/Help Viewer.app: scriptable Mac OS X application package type: 'APPL' creator: 'hbwr' bundle ID: com.apple.helpviewer kind: Application [...]
The Finder actually uses a slightly different method, but this one is much more space-efficient.
% touch blah.html % /Developer/Tools/SetFile -c 'hbwr' blah.html % launch blah.html
and you'll see blah.html open in Help Viewer.