Operator overloading allows operators like + and << to be used with user-defined types like classes. It is done by defining corresponding operator functions like operator+() and operator<<(). This allows objects to be used with operators in a natural way while providing custom behavior for that type. The rules for overloading include maintaining precedence and associativity of operators. Common operators like +, -, *, /, <<, >>, ==, =, [] and () can be overloaded to extend the behavior of classes.