No really! It's not that hard...
First you check each asteroid once per game cycle, and perform calculations based on its size and distance of all the other asteroids in the map, and their sizes, and that will give you all the forces acting upon that asteroid.
Then you create variables for the angle the asteroid is travelling and its current momentum.
By calculating what effect the net gravitational forces are having on the asteroid, you can calculate (for each game cycle) the changes to its angle and momentum, and then move it in that direction by however much the momentum value dictates.
That's the engine of the gravity system. To create an actual solar system, you would need to create all the asteroids in LevelSetup() and give them just the right initial angle and momentum to cause them to orbit whatever body they are nearest.
By coding it with a proper gravity engine and not just a bunch of fixed asteroids with given properties, the whole thing will be highly adaptable and re-usable, and I will be able to create some really stunning features like asteroids that fly off their orbit into space, binary star systems, etc. By adding an asteroid density variable into the gravity engine I could also potentially create black holes...