Despite this, do read "House of God" --- it's a terrifying and eye-opening book!
In the past, transferring assets to such a trust entailed gift tax, but since the estate tax and lifetime gift tax exemption are now bundled together, you can basically "use" the estate tax exemption to fund this irrevocable trust "for free". As a result your personal assets plummet, you name your heirt the beneficiaries of the irrevocable trust, and you (the parent) can take advantage of medicare fully as you describe.
The drawback to this strategy is that you do lose real flexibility in controlling your assets. Also, the legality of this widespread practice is definitely in a gray zone and carries future legal risk. Transferring a significant portion of one's assets to such a complex instrument is definitely not advised.
Capital gains costs bases are currently "stepped up" during the estate transfer. No need to pay anything to lawyers. If your estate is below $10.5M (or thereabouts, I forget what the exact number is since it's now inflation adjusted), you won't be liable for any of that capital gains, nor will you owe any estate tax since you're within the exemption.