We present an elementary and self-contained construction of $A_\infty$-algebras, $A_\infty$-bimodules and their Hochschild homology and cohomology groups. In addition, we discuss the cup product in Hochschild cohomology and the spectral sequence of the length filtration of a Hochschild chain complex. $A_\infty$-structures arise naturally in the study of based loop spaces and the geometry of manifolds, in particular in Lagrangian Floer theory and Morse homology. In several geometric situations, Hochschild homology may be used to describe homology groups of free loop spaces. The objective of this article is not to introduce new material, but to give a unified and coherent discussion of algebraic results from several sources. It further includes detailed proofs of all presented results.