Writing/Creating MIDI Files

Has someone got some code (as cpp, as a class or component)
that implements the SIMPLE writing of Midi Files?

E.g. it allowes simple calls like :

int note = 60;
int length = 2;
int velocity = 40;
MIDIComponent->AddTrack();
MIDIComponent->AddNote(note,length,velocity);
.
.
.

MIDIComponent->WriteToFile("c:\\miditext.mid");

Something like that would look like easy to use for me... but I searched
the web
for a class/component like that - and what i found was only delphi code
that
does not really work with Borland C++ Builder.

Thanks for suggestions !!

Christian