This is a really good question and a really big source of frustration for many people. In truth, there are only a few options when you find yourself in this kind of a situation.
First, you can simply listen and do nothing. This is no fun for you and it will teach the rude conversationalist nothing, but it is the easiest and least confrontational option.
Second, you can politely find a way to extricate yourself from the conversation. This works best if you are in a group, of course, but it is possible in a one-on-one situation, as well.
Third, you can start your own comment when the long-winded talker takes a breath and, when he tries to cut back into the conversation, politely remind him it is your turn to speak. Perhaps he will get the hint.
Of course the fourth option is to interrupt the person, either to speak or to let him know how rude he is being. This is a rick, but it is the surest way to make the problem known.
Unfortunately, the reality is that no matter what you do, the determined talker will not be deterred and will continue on his merry way. The other reality is that this person is generally not as interesting as he thinks he is, so continuing to listen to him is probably something you do not want to do anyway.
Emily Post is kind of a national expert on etiquette, and she gives this advice to the excessive talker:
Above all, stop and think what you are saying! This is really the first, last and only rule. If you “stop” you can’t chatter or expound or flounder ceaselessly, and if you think, you will find a topic and a manner of presenting your topic so that your neighbor will be interested rather than long-suffering.
Again, however, this only works if the excessive talker is willing to recognize his fault and is willing to correct it. Being stuck in such a conversation is always a reminder to me that this is not what I want to do to others.