Write them like regular functions named "operator<<" and "operator>>".
operator<< should take an "ostream &" (the type of cout and other output streams) as its first argument, and it should take either "YourClass" or "const YourClass &" as its second argument. It should return an "ostream &", which should just be its first argument (this allows output commands to be chained).
operator>> should take an "istream &" (the type of cout and other output streams) as its first argument, and it should take "YourClass &" as its second argument. It should return an "istream &", which should just be its first argument (this allows input commands to be chained).
You may need to declare the input operator (or both) to be friends of your class in orger to access its private data.