How do you prove that Hochschild cohomology is Morita invariant? I am simply trying to show that $HH^\bullet(A)= HH^\bullet(M_r(A))$ for any matrix ring of $A$. 
In Loday's book (Sect 1.5.6) the Morita invariance is explained as follows : it says that if $M$ is an $A$-bimodule, we have
$$HH^\bullet(M_r(A),M_r(M))= HH^\bullet(A,M) $$
If I put $M=A^*$, we get $HH^\bullet(A)=HH^\bullet(A,A^*)$ (Hochschild cohomology of $A$)
As per the formula, we get the left hand side to be $HH^\bullet(M_r(A),M_r(A^*))$. 
We would expect that the left side should give the Hochschild cohomology of $M_r(A)$. Hochschild cohomology of $M_r(A)$ is $HH^\bullet(M_r(A))=HH^\bullet(M_r(A),M_r(A)^*)$. 
So it remains to show that $M_r(A^*)=M_r(A)^*$ as $M_r(A)$-bimodules.
While this seems isomorphic as $k$-vector spaces, the isomorphism does not look like it preserves $M_r(A)$-bimodule structure.
Are we getting something wrong? Is the Morita invariance of Hochschild cohomology to be proved in some other way? 
 A: It is even a derived invariant. Here is a proof in a special case, but Im not sure whether it works more general (with the same proof?)
Let $A$ and $B$ two noetherian $K$-algebras for a commutative ring $K$ that are projective as $K$-modules.
Then a standard derived equivalence $F=X \otimes_A^L: D^b(A) \rightarrow D^b(B)$ with quasi-inverse $G=Y \otimes_B^L $ induces a derived equivalence between the derived bimodule categories $H=(X \otimes_A^L - ) \otimes_A^L Y : D^b(A^e) \rightarrow D^b(B^e)$ where $A^e=A^{op} \otimes_K A$.
Now the Hochschild cohomology has terms $Ext_{A^e}^l(A,A)$ but $H$ sends $A$ to $B$ and thus preserves Hochschild cohomology. (it also preserves $A^{*}$ in case $A$ is finite dimensional, not sure about the general case)
A: You are right that the ``obvious'' isomorphism $M_r(A^*)\cong M_r(A)^*$ does not preserve the $M_r(A)$-bimodule structure. However, there is another isomorphism that does, essentially given by taking the transpose. It comes from the perfect pairing
$$
\langle -,-\rangle :M_r(A^*)\times M_r(A)\to k, f_j^i\otimes a_l^k\mapsto \sum_{i,j} f_j^i(a_i^j)
$$
More invariantly, it is given by $\langle F,X\rangle = \operatorname{Tr}(FX)$, where the product is essentially the usual product of matrices, but multiplication of scalars is replaced by evaluation of functions on elements of $A$. Using the cyclic property of the trace, it is straightforward, if tedious, to verify that
$$
\langle F,XYZ\rangle = \langle ZFX,Y\rangle
$$
(again, the matrix multiplication notation means that multiplications of scalars need to be replaced with the bimodule action of $A$ on $A^*$) which shows that the induced isomorphism $M_r(A^*)\cong M_r(A)^*$ respects the bimodule structure.
The abstract reason for Morita invariance of Hochschild (co-)homology is that these invariants can be defined for any dg-category $\mathcal C$ by the derived coend and end
$$
HH_\bullet(\mathcal C) = \left(\int^{\mathcal C}\right)^{\mathbb L}\operatorname{Hom}_{\mathcal C}(-,-), HH^\bullet(\mathcal C) = \int_{\mathcal C}^{\mathbb R}\operatorname{Hom}_{\mathcal C}(-,-)
$$
Taking for $\mathcal C$ the category with one object whose endomorphisms are $R$ recovers the cyclic bar complex computing Hochschild (co-)homology. However, we may as well use its idempotent completion, the category of projective $R$-modules, and get equivalent complexes. Since the categories of projective $A$- and $M_r(A)$-modules are equivalent, this gives Morita invariance of Hochschild (co-)homology. To get the more general statement involving a bimodule, pass to the square-zero extension $A\oplus M$ of $A$ defined by it, and note again that its category of projective modules is equivalent to that of projective $M_r(A)\oplus M_r(M)$-modules.
