The OTComp tool takes a font file and a file containing feature information to produce an OpenType file. You can download the binary (i.e. a working program file) for Windows. You may also take a look at the source. It now implements almost all lookups. A tutorial is available.
There are also other tools available that also produce OpenType layout tables.
Personally, I feel using text input for an OpenType layout compiler is useful since it allows you to start with the same file for the various different faces (regular, bold, italic) and to change only the parts that are different for this face. OTComp mirrors the OpenType file format pretty closely, providing a powerful tool.
For examples please take a look at the sources of my fonts.