I'm in my late 40's, and I'm not sure why I resisted maxing out and investing the surplus in my HSA for so long. I had been just putting in enough to maintain about $3000 in cash balance to cover my usual annual expenses plus my $2600 deductible.
An article in our company health newsletter about funding medical costs in retirement finally made me realize that I was missing out on a 7.65% discount (SS and Medicare). So I shifted part of the contributions from my 401k to my HSA two weeks ago so I can max out my contributions by the end of the year, and I invested everything over my deductible in Vanguard Total Stock Market. I'll be paying $3.50/month in fees, but I'm fairly certain I'll be making more than that on the investment by the end of the year.
A nice feature of our plan is that you can have it sweep anything over a certain dollar amount directly into your investments. Then if you use some of the cash portion for expenses, it will keep the paycheck contributions in cash until your balance hits the sweep limit again.
I hope to retire early, since my spouse is 13 years older than me and plans to retire at full SS age. So I'm pretty worried about healthcare for me until I hit Medicare age (if it's still around by then). And if by some miracle I don't need the money for healthcare, I'm not any worse off than if the money was in my 401k (also in Vanguard funds).