Wow, this turned out to be more difficult than it at first seemed. I have the same question going on stackexchange as well and it has no answers either! (and they’re usually quick to come up with an answer there)
An alternative question is then to not be as specific and just ask the following:
How can I use the media library in a custom widget?