Your best bet is CoreMidi
https://developer.apple.com/library/ios/documentation/MusicAudio/Reference/CACoreMIDIRef/_index.html
Garage Band speaks midi, and if your app sends midi signals either over USB or some other protocol (like Bonjour to a listening client app) you can interact with GarageBand this way.