I would say to avoid them like the plague. This type of person is so annoying and so full of themselves that they believe no one else has anything worthwhile to say so they go on and on.
If you are unable to avoid them and have to deal with them, then I would say that you have to make it a point to put up a hand or ask them to give you a chance to say how you feel. Take a deep breath as they may completely ignore your efforts.
It's a very frustrating situation to deal with. I had an incident of this just last week and it still irks me.