Some people make good use of the Notation package but I have never been very successful with it. A good reason to learn a little about MakeBoxes and TemplateBox.
The following MakeBoxes definition will format your expression.
MyHead /:
MakeBoxes[MyHead[a_, b_],
form : (StandardForm | TraditionalForm) : StandardForm] :=
InterpretationBox[#1, #2] & @@ {GridBox[{{MakeBoxes[a,
form]}, {MakeBoxes[b, form]}},
GridBoxDividers -> {False, {{False, True}}}], MyHead[a, b]}
The InterpretationBox's arguments are held so using the trick of making it a pure function and applying it to a List allows you compute the format if necessary. The list could be generated by an extended Module calculation. The first item in the list is the formatted expression and the second is the internal expression, the same as the initial expression. The following should then work.
MyHead[a, b]

MyHead[5 x + 3, 2 x - 1]

One disadvantage of this is that the output can be copied and pasted but not edited.
An alternative approach uses TemplateBox, which is a documented function in Version 9.
Clear[MyHead];
MyHead /:
MakeBoxes[MyHead[a_, b_],
form : (StandardForm | TraditionalForm) : StandardForm] :=
Module[{dispFunc},
dispFunc =
GridBox[{{#1}, {#2}},
GridBoxDividers -> {False, {{False, True}}}] &;
TemplateBox[{MakeBoxes[a, form], MakeBoxes[b, form]}, "MyHead",
DisplayFunction -> dispFunc,
InterpretationFunction -> (RowBox[{"MyHead", "[", #1, ",", #2,
"]"}] &)]
]
With TemplateBox you write a pure function for the DisplayFunction and for the InterpretationFunction. The first item in Template generates the items that will fill the slots. The resulting output can be copied, pasted and the items that fill the slots can be edited - but not other parts of the formatted expression.
This approach has normal input and formatted output. Formatted input is not always that convenient because it can be a chore to manuever between the various input boxes. If you want formatted input then you need to use MakeExpressions and probably put the form on a palette to paste in your notebook. I don't use MakeExpressions much so I'm going to skip giving an example for that.