Publishing an idea that came up on a conference?
You should definitely get in touch with Prof B, but don't propose a collaboration immediately (that would indeed be a little bit presumptuous). 

Thank him for his idea during the conference, and tell him some outline of your results (you may want to share the paper if you feel comfortable). And then end the email with something like "given that the origin of the idea was initially yours, I was wondering how you felt about a possible co-authorship? If you feel that this is not possible, would you mind if I put forward your name in the acknowledgments section?"

That way you leave the choice up to him, and he can have an easy way out if he doesn't feel like being a co-author for any reason.

(EDIT: Regarding Prof A, it might be good etiquette to get in touch with him to make sure he's not working on the same stuff, but I don't think it's strictly necessary)