Let $M$ be a topological monoid. $M$ can be considered as a category internal to topological spaces and has a simplicial space $N_\bullet(M)$ as its nerve. (It's also called the internal nerve.) The geometric realization $BM=|N_\bullet(M)|$ of this simplicial space is the classifying space $BM$. (This includes the discrete case.)
Unveiling the definitions, it is given by $$BM=(\coprod\limits_{n\ge0}M^n\times\Delta^n)/\tilde{}.$$(in the answer of archipelago)
Could we write out the explicit equivalent relation $\sim$? Any reference? Thanks.
In general, if $X_\bullet$ is a simplicial space, then its geometric realization is given by $$|X| = \left( \coprod_{n \ge 0} X_n \times \Delta^n \right) \biggm/ \sim,$$ where the equivalence relation is generated by $$(f^*x, u) \sim (x, f_*u),$$ where $f : [m] \to [n]$ is a morphism in the simplicial category $\Delta$ (ie. it's a nondecreasing map $\{0 < 1 < \dots < m\} \to \{ 0 < 1 < \dots < n \}$, $x \in X_n$ and $u \in \Delta^m$ ($\Delta^\bullet$ is given the standard cosimplicial structure to define $f_* u$). Since $\Delta$ is generated by cofaces and codegeneracies, you can restrict to these.
Note: This is a particular instance of a coend: $|X| = \int^{n \in \Delta} X_n \times \Delta^n$.
In the case of $BM$, you have $N_n(M) = M^n$. Faces and degeneracies are given by: $$d_i(m_0, \dots, m_n) = \begin{cases} (m_1, \dots, m_n) & i = 0 \\ (m_0, \dots, m_{i-1}, m_i \cdot m_{i+1}, m_{i+2}, \dots, m_n) & 1 \le i \le n-1 \\ (m_0, \dots, m_{n-1}) & i = n \end{cases}$$ $$s_j(m_0, \dots, m_n) = (m_0, \dots, m_{j-1}, e, m_j, \dots, m_n) \qquad (0 \le j \le n)$$
If you represent $\Delta^n = \{(u_0, \dots, u_n) \in \mathbb{R}^{n+1} \mid \sum u_i = 1, u_i \ge 0 \}$, then cofaces and codegeneracies are given by: $$\delta^i(u_0, \dots, u_n) = (u_0, \dots, u_i, 0, u_{i+1}, \dots u_n)$$ $$\sigma^j(u_0, \dots, u_n) = (u_0, \dots, u_{i-1}, u_i + u_{i+1}, u_{i+2}, \dots, u_n)$$ and $BM = \left( \coprod_{n \ge 0} M^n \times \Delta^n \right) \bigm/ \sim$, where $\sim$ is generated by $(d_i(\underline{x}), \underline{u}) \sim (\underline{x}, \delta^i(\underline{u}))$ and $(s_j(\underline{x}), \underline{u}) \sim (\underline{x}, \sigma^j(\underline{u}))$.
It is possible to have a rough "visualization" of what the classifying space looks like. For simplicity consider a discrete $M$ (the description is roughly the same in the general case). You can think of it as an infinite dimensional simplicial complex where there is:
It's a bit simpler to visualize the total space of the universal bundle $EM \to BM$; I think Hatcher gives a description of it in the book Algebraic Topology (search for "classifying space"). It has a vertex for every element of $M$, and a similar description for edges, triangles, tetrahedrons...
Possible reference: