If you take the general class of CES utility functions, of which Cobb-Douglas is a special case, you do indeed get a demand function that depends on other prices. Specifically, the CES utility function (over $n$ goods, $x_1,\dots,x_n$) takes the form
\begin{equation}
u(x_1,\dots,x_n)=\bigl[\alpha_1x_1^\rho+\cdots+\alpha_nx_n^\rho\bigr]^{1/\rho},
\end{equation}
where $\rho\in(-\infty,1]\setminus\{0\}$, $\alpha_i\in[0,1]$ and $\sum_i\alpha_i=1$. We interpret $\alpha_i$ as the consumption share of good $i$ and $\sigma\equiv\frac{1}{1-\rho}$ as the constant elasticity of substitution. Note also that when $\sigma=1$ (or $\rho\to0$), we get the Cobb-Douglas utility form.
Solving utility maximization subject to the usual budget constraint, we get the demand for good $i$ as
\begin{equation}
x_i(p_1,\dots,p_n,M)=\frac{M(\alpha_i/p_i)^\sigma}{\sum_{j=1}^n\alpha_j^\sigma p_j^{1-\sigma}},\quad i=1,\dots,n.
\end{equation}
Again, observe that when $\sigma=1$ we get the demand associated with Cobb-Douglas utility.
The elasticity of substitution governs how relative expenditures on different goods change as relative prices change. Take a two-good example. An increase in the relative price $p_1/p_2$, i.e. good 1 becoming relatively more expensive, causes two effects simultaneously:
- per unit expenditure on good 1 rises, as good 1 now costs more in relative terms; and
- quantity demanded for good 1 decreases due to law of demand.
These are opposing effects on the expenditure on good 1 relative to that on good 2. It turns out that the elasticity of substitution determines which effect dominates. If $\sigma>1$, the second effect dominates, and if $\sigma<1$, the first effect dominates. When $\sigma=1$, which is the case of Cobb-Douglas, the two effects cancel each other exactly, so that relative expenditure is independent of the relative prices, and depends only on preference parameters (the $\alpha_i$'s).
Of course, CES utility is not the only class of utility functions that generate demands dependent on prices of other goods. Another common form of utility function, the quasi-linear utility function,
\begin{equation}
u(x_1,\dots,x_n)=x_1+v(x_2,\dots,x_n),
\end{equation}
where $v(\cdot)$ is strictly increasing and strictly concave, also generates demand functions that depend on other prices. A common example is $u(x_1,x_2)=x_1+2\sqrt{x_2}$. I trust that you can verify that both $x_1$ and $x_2$ depend on the two prices $p_1$ and $p_2$.