The OED gives two (related) definitions for "to the tune of":
- According to the gist of, in accordance with (obs.).
- To the amount or sum of. So to some tune (to a considerable extent), etc.
The two are put together as definitions 1a and 1b, and share the same quotations, suggesting that the former gradually evolved into, and was replaced by, the latter. The first few citations provided are:
1607 S. Hieron Wks. I. 405 Singing nothing but to the tune of Judas 'What will ye give me?'
1692 R. L'Estrange Fables ccclvi. (1694) 372 This came to the Bishop's Ear, who presently sent for the Curate, Rattled him to some Tune.
1714 R. Fiddes Pract. Disc. II. 95 This is exactly to the tune of the old popular objection.
1716 M. Davies Athenæ Britannicæ II. 296 To Libel the Bishop‥by exhibiting Articles against him to the Tune of 56.
1723 D. Defoe Hist. Col. Jack (ed. 2) 134 To go over‥into Flanders, to be knock'd on the Head at the Tune of Three and Six-pence a Week.
The first example makes the musical metaphor underlying the phrase fairly explicit. The second uses the phrase to some tune to refer to an extent or amount. The fourth applies the phrase to a number, and the fifth applies it to currency. The progression seems pretty clear to me.
To sum up: "to the tune of" seems to have originally meant the same as the current phrase "along the lines of", i.e., "similar to" or "something like". It's not hard to imagine the thought process behind applying such a phrase to an approximate or estimated number. Although current usage strongly associates the phrase with currency, there's ample historical precedent for phrases like "to the tune of a three-course meal."