We have a [sdk/platform/xpcom](https://github.com/mozilla/addon-sdk/blob/master/lib/sdk/platform/xpcom.js) module for defining XPCOM components.