• Who saw you?
• Whom did you see?
It is also strictly right to use whom after a preposition.
• To whom were you talking just now?
In practice, few people follow this rule. Most use who all the time and a sentence like the following one can sound too formal.
• To whom were you talking?