methinks that there must be other solutions out there that don´t involve programming, but if you want to do it - have a look at core32 tutorial 4 (sending midi):
http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Ftutorials%2F004_sending_midi%2F
in app.c, a MIOS function named SendCC is called like this:
MIOS32_MIDI_SendCC(port, Chn1, 1, midi_package.velocity);
if you combine that with code from tutorial 10 (DIN) which executes it when you press a button, you are almost done...