For classical polynomials orthogonal with respect to a positive measure supported on the real line, the moment matrix is Hankel and positive definite. The polynomials satisfy a three term recurrence relation. When the measure is supported on the complex unit circle, the moment matrix is positive definite and Toeplitz. They satisfy a coupled Szegö recurrence relation but also a three term recurrence relation. In this paper we study the generalization for formal polynomials orthogonal with respect to an arbitrary moment matrix and consider arbitrary Hankel and Toeplitz matrices as special cases. The relation with Padé approximation and with Krylov subspace iterative methods is also outlined.