Of the probably ten thousand or more samples that these companies each send out per year, a small percent will wind up in a product that will get mass produced, resulting in millions of sales. For the small cost of the samples, versus the millions in revenue generated as a result, it is well worth it.
Take the switching regulator as an example. If National sends out two switching regulators to 1000 customers this year (so 2000 switching regulators) that cost them $0.50 each to manufacturer and $1.00 in shipping. Those samples cost the company $2000.00. If only two of the customers (that's only 0.2%) use the switching regulator in products, and each sells 1000 of that product, National has just made their money back and a small profit. On top of that, those two customers are going to be more likely to purchase other chips and semiconductors from National, seeing as how well the switching regulators worked out for them.