This paper is a fundamental study of comodules and contramodules over a comonoid in a closed monoidal category. We study both algebraic and homotopical aspects of them. Algebraically, we enrich the comodule and contramodule categories over the original category, construct enriched functors between them and enriched adjunctions between the functors. Homotopically, for simplicial sets and topological spaces, we investigate the categories of comodules and contramodules and the relations between them.