Setting up an ad network that charges advertisers, targets ads and then compensates site owners is not a fun way to monetize a widget. It's recreating AdSense from scratch. Think of the tax issues alone!
If you could build that ad system, coming up with 5 million impressions would be the easy part.
You would not need to build an ad network. There are a few hungry ad networks out there already that offer text ads and have systems similar to this already in place.
The only challenge really is in categorizing the sites where the widget appears (to target the ads so that the CPM ratio doesn't make it worthless). Past that, it's really just seeing who has a good base of customers buying text ads and letting them handle all of the dirty work.
If you could build that ad system, coming up with 5 million impressions would be the easy part.