No way from here to know which wire fed the light or fan, but you have a continuous hot feed into the box that fed the receptacle, light and fan. The third wire, maybe it fed the fan or maybe something something else farther down the line, if the latter that needs to be tied in 100 percent to the hot feed. All whites still tied together, blacks to the dimmer from the light and hot. All grounds tied together set with a screw to the metal box. Securing the ground to the box is not needed if the box is plastic.
Before I got too wordy, here is a sketch
![enter image description here](https://i.stack.imgur.com/Siq1s.png)
Still have to learn to format better
The sketch is a little rough, it should get the idea across I hope
TL;DR -- find the breaker that shuts that red wire off, then slap the builder with it, so to speak
The builder of your house needs a slap with the NEC. There are two very clear Code violations here, and they're both things that are trivial to avoid.
First off, the lack of panel labeling isn't just a massive inconvenience to you, it's against Code -- the NEC requires it so that the next electrician/homeowner who looks at the panel can actually figure out what breaker to shut off to make a circuit safe or get that sparking oven to quit. In particular, it'd get dinged for busting 110.22(A):
110.22 Identification of Disconnecting Means.
(A) General. Each disconnecting means shall be legibly
marked to indicate its purpose unless located and arranged
so the purpose is evident. The marking shall be of sufficient
durability to withstand the environment involved.
and 408.4(A)
408.4 Field Identification Required.
(A) Circuit Directory or Circuit Identification. Every
circuit and circuit modification shall be legibly identified as
to its clear, evident, and specific purpose or use. The identification shall include an approved degree of detail that
allows each circuit to be distinguished from all others.
Spare positions that contain unused overcurrent devices or
switches shall be described accordingly. The identification
shall be included in a circuit directory that is located on the
face or inside of the panel door in the case of a panelboard
and at each switch or circuit breaker in a switchboard or
switchgear. No circuit shall be described in a manner that
depends on transient conditions of occupancy.
Second, what you have is indeed a Multi-Wire Branch Circuit (MWBC) -- the 52V on the black wire with breaker #23 OFF is stray capacitive coupling from the still-live red wire. The red wire, of course, is still live because of another Code violation, this time of 210.4(B):
(B) Disconnecting Means. Each multiwire branch circuit
shall be provided with a means that will simultaneously
disconnect all ungrounded conductors at the point where
the branch circuit originates.
So, it's time to find the breaker that turns off that darn red wire (leave #23 off while you do this!). Hopefully it will be adjacent to Breaker #23 -- in that case, you can get a handle-tie from the electrical supply house and handle-tie the two dodgy breakers together to fix the issue as per 240.15(B)(1). If the builder was as clueless as I fear though, that breaker is somewhere totally else in the panel -- something you'll want an electrician to fix.
Best Answer
All connections must be in a junction box. They're mentioned several times in the instruction manual.
It is odd that this model doesn't provide an integrated box, but you're expected to provide one. Either that or we're all misled by poorly-written instructions and the connections should be made inside the fan housing as with every other fan ever made. Ever. Be sure to use a strain relief on the knockout (which is also usually included).