Since you're here, I've made it a tad easier for you and itemised the use-cases.
1) Adding custom libraries which are GLOBAL to your application
Edit composer.json and add within the closure,"autoload": {
"psr-0": {"MyLibrary\\":"vendor/my/library/path"}
}
Then run "composer update" from the CLI under your application root directory. This will add an entry to your <APPLICATION_PATH>/vendor/composer/autoload_namespaces.php.
Alternatively, you can directly add an entry to it.
return array(
'Zend\\' => array($vendorDir . '/zendframework/zendframework/library'),
'MyLibrary\\' => array($vendorDir . '/my/library/path'),
);