User gets first x units of a product free, then has to pay per unit thereafter
You will probably want to look at the Userpoints API (http://drupal.org/documentation/modules/userpoints) and possibly utilized Rules in conjunction with an eCommerce solution like UberCart.

Or, if you don't need to actually take payment in money at all, there is a Userpoints Contrib module for facilitating points in conjunction with downloads.

userpoints-download
Users lose or gain points when the download attachments (requires site to be configured with private download method).