Some interesting examples of Cohen-Macaulay but not Gorenstein rings: 1) Determinantal rings: Let $m\geq n\geq r>1$ be integers. Take $S=k[x_{ij}]$ with $1\leq i\leq m, 1\leq j\leq n$ and $I$ be the ideal generated by all $r$ by $r$ minors. Then $R=S/I$ is CM, but is Gorenstein if and only if $m=n$. $R$ has dimension $(m+n-r+1)(r-1)$. 2) Veronese subrings: Let $S=k[x_1,\cdots,x_n]$ and $R=S^{(d)}$ be the $k$-subalgebra of $S$ generated by the monomials of degree $d$. Then $R$ is always CM, but is Gorenstein if only if $d$ devides $n$. $R$ has dimension $n$. 3) Semigroup rings: Let $R=k[t^{a_1},\cdots, t^{a_n}]$. $R$ is $1$-dimensional domain, so CM. $R$ is Gorenstein if and only if the semigroup generated by $(a_1,\cdots,a_n)$ is symmetric. For higher dimension one can use the trick in BCrad's comment.