Don't let the name fool you.
"Mac Binary" means little. They're binaries...
The purpose of the format is to have only a data fork, no resource fork, so that they can be perserved on Windows/*NIX servers etc - which tend to destroy the resource fork of files (their filing systems can't handle them).
The files decompress into a multi-fork file.
You can't decompress them without third party utilities, and you don't convert a file to macbinary with raw C++... use a third party app, and if you feel so inclined to write your own, get the libraries/algorithms somewhere...