Token Example Module
I think it's fair to say the new Civi\Token\TokenProcessor model is still evolving, but the older method still works and is the easier option for now unless it is not sufficient for your needs.

You can find a range of extensions doing things with tokens here