The physics of the CMB is remarkably simple. For a good introduction, I would recommend Wayne Hu's webpages that talk about all of this and more.
Planck, WMAP, and other CMB experiments measure the brightness of a radiation field that is predicted in an expanding Universe. The intensity of the radiation is that of a black body radiating at a certain temperature, so the signal is quantified as a temperature measurement.
The introduction is here: http://background.uchicago.edu/~whu/beginners/introduction.html
A summary:
In the simple model of the CMB, there are essentially three things that matter early on: "dark" matter (DM), "regular" matter (i.e. matter that interacts with itself and photons, aka baryons), and photons (light). The Universe, thanks to inflation, starts off very, but not perfectly smooth. There are little density enhancements against this smooth background. There is more DM than baryons, so the dark matter in the overdense regions collapses, forming dense regions. The baryons follow along for the ride. At some point, the regular matter starts to heat up and provides a pressure to support against the dark matter gravitational collapse. In effect, this causes an oscillatory "bounce" for some of these overdense regions.
At the same time, the Universe is expanding and cooling. At some point, the Universe will cool to the point where protons and electrons combine to form Hydrogen (recombination). At this point, the photons are no longer bound to the matter, and they stream directly across the Universe (more or less) until they enter a telescope. Since the CMB is from this instant of recombination, there is a sharp cut-off to the oscillations early on. The strength and size of the oscillations is basically what Planck measures. The ratio of dark matter to regular matter is set by the relative heights of the oscillations. (More regular matter means a bigger bounce. More dark matter means more compression.)
The evidence for Dark Energy is a bit more complicated. However, at the most basic level, the simple model outlined above predicts a very specific size for the regions that have time to collapse between the Big Bang and recombination. By measuring the apparent size of these regions on the sky, you can estimate the curvature of space between the telescope and the CMB. If the Universe isn't curved, the energy density in the Universe is equal to the critical density (i.e. there's just enough stuff to cause the expanding Universe to coast to a 0 expansion at infinity). The CMB shows matter accounts for 30% of the critical density and the total is 1. Therefore "something else" is 70%, and Dark Energy is a convenient explanation (although not the only explanation).
Planck's measurement is a little bit more complicated. As Planck has better resolution than WMAP, it's able to tell a little bit more about things. This is because at the large scales probed by all-sky surveys, the physics I mentioned above matters. As you get to smaller scales (small patches on the sky) more "local" physics dominates. As an example, galaxies in between us and the CMB we observe can gravitationally lens the light of the CMB, which adds information about the large-scale structure between us and the CMB, which provides some insight into Dark Energy. Galaxy clusters are an example of this, and their number density depends a lot on Dark Energy because they take such a long time to form.
Hope this helps.
Best Answer
The temperature 2.73 K is not calculated, it is measured. The cosmic microwave background (CMB) has the properties of a blackbody radiation at the temperature 2.73 K. It is based just on the measurement of CMB, no calculation of dark matter or dark energy is involved.
Temperature does not simply depend on mass or gravity. Temperature is a quantity which in a lot of situations is difficult to define. For example a black hole can be extremely massive and have huge gravity, but the black body radiation from such a black hole is extremely cold. If there is nothing falling into the black hole, there won't be any other radiation.
The dark energy particles (if dark energy is made up of particles) do not interact electromagnetically or strongly (and maybe not even weakly), so they play virtually no role in our discussions about what we call "temperature of the universe".
We know basically nothing about dark energy, so it also is not included in our definition of temperature.