I did a vanilla porter a while back where I added a whole bean split and scraped into a shot glass with some Captain Morgan's private stock and let it sit for a week before adding to the beer. I let the beer sit on the bean for a week or two before bottling.
The next time I do this I'm probably going to add 1/2 a bean in during the last 5 minutes of boil, and then 1 and 1/2 in the rum like before.
Chocolate can be added in powder form during the late boil, and or as cocoa nibs in secondary. Right now I have a porter sitting on nibs in secondary that I'm checking daily for my desired chocolate strength.
If adding espresso I'd probably use whole or roughly chopped beans in a hop bag added to a secondary with the vanilla bean + rum mix. The quantity will depend on your taste. No matter how many you decide to use, if you do it in secondary make sure to taste your beer daily to catch it at the desired strength. Another option would be to brew up some espresso and use it as part of your water additions. I would not boil the beans though, as you'll get undesirable bitterness.