Trying to make a shape, never used curves
Alrighty, to model this shape, let's start with the large curved section since it is super easy.

Add a Bezier curve by pressing ⇧ ShiftA and selecting Curve → Bezier.

Adjust the curve's Depth to add some thickness.


Set the Resolution to a manageable amount. I'll use a Resolution of 2 which yields 8 sides.


Adjust the shape to your liking.

Set Resolution Preview U to a suitable amount for modeling. I used 20.




Modeling

For this part, the curve must be converted into a mesh. Press W and select Convert to Mesh.

In edit mode, find the place that the connecting segment should be. Select the top vertex and the one directly below it and snap the cursor to them using ⇧ ShiftS.


Duplicate either one and move it to either side (just so that it can be seen more easily).


Use the Spin tool to spin the vertex around the x axis. Use the same number of steps as the curve has (in my case 8).


Select the entire circle with ⎈ CtrlL and make it a separate object by pressing P and selecting Selection.

In face select mode (3), select the outside faces of the tube shape and hide them (hold ⇧ Shift⎇ Alt to select multiple loops of faces and press H to hide them).


In side view, go to the Mesh menu and click Knife Project. Press f9 and click Cut Through.


Delete the faces on the inside of the cut on each side and merge any problem vertices to ensure that the perimeter of the cut has 8 sides.


In edge select mode, select both loops, press W, and select Bridge Edge Loops.


If you need extra high quality, you can add support loops and a Subdivision Surface modifier to smooth out the transition. If you want it to be extra perfect you can get rid of the triangle as well, but I'm too lazy for that.



Tada!