v is velocity and b is just a constant (which should proportional to the cross section of the object ..).
The drag force f=-b*v is a good approximation for relative small velocity.
For larger velocity in air, the drag force will be proportional to square of velocity.
You can check out http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=549.0

If the object need to move upward in the beginning. Just give them an upward initial velocity. Then it should be fine.

How to related those formula to the computer code?
You can use Runge-Kutta 4-th order method (library are available on the web).
If you use the EJS (Easy Java Simulation) tool, you just need to provide the equation and EJS will generate all the code for you. But if you want to code it with C by yourself.  You need to know how to do the numerical calculation with computer code or just copy existing library/code.