Have a look at this vb6 project

It simulates gravity and elastic collisions in 2D. Use the mouse to grab and throw the balls.