We study the Smith forms of matrices of the form f(Cg) where f(t),g(t)∈R[t], where R is an elementary divisor domain and Cg is the companion matrix of the (monic) polynomial g(t). Prominent examples of such matrices are circulant matrices, skew-circulant matrices, and triangular Toeplitz matrices. In particular, we reduce the calculation of the Smith form of the matrix f(Cg) to that of the matrix F(CG), where F,G are quotients of f(t),g(t) by some common divisor. This allows us to express the last non-zero determinantal divisor of f(Cg) as a resultant. A key tool is the observation that a matrix ring generated by Cg – the companion ring of g(t) – is isomorphic to the polynomial ring Qg=R[t]/<g(t)>. We relate several features of the Smith form of f(Cg) to the properties of the polynomial g(t) and the equivalence classes [f(t)]∈Qg. As an application we let f(t) be the Alexander polynomial of a torus knot and g(t)=tn−1, and calculate the Smith form of the circulant matrix f(Cg). By appealing to results concerning cyclic branched covers of knots and cyclically presented groups, this provides the homology of all Brieskorn manifolds M(r,s,n) where r,s are coprime.