Buck-boost Inductor volt-second balance
No, you have it right so far. \$v_L\$ is equal to \$V_g\$ for the first part of the cycle and \$V_{out}\$ for the second part. So your volt-seconds balance equation ends up being:

$$DV_g + (1-D)V_{out} = 0$$

The negative sign comes out of the algebra you do to isolate \$V_{out}\$ on one side of the equation.

UPDATE: Sign convention doesn't really tell you anything about the physical voltage, it just determines the signs in your equations. If you invert the polarity of \$v_{out}(t)\$ in the schematic, your volt-seconds equation becomes: 

$$DV_g - (1-D)V_{out} = 0$$

and \$V_{out}\$ will be "positive". But \$V_{out}\$ didn't really change -- the lower potential is still at the top node; you just defined that to be "positive"! In your graph, the inductor voltage will be positive for one part of the cycle and negative for the other. You can choose which is which by defining the polarity, but they'll always be opposite.

UPDATE 2: You asked how we get a negative voltage. Start with the volt-seconds balance equation:

$$DV_g + (1-D)V_{out} = 0$$

Solve for \$V_{out}\$:

$$V_{out} = -\frac{D}{1-D}V_g$$

So if \$V_g\$ is positive, \$V_{out}\$ will be a negative number. The sign convention tells you that a negative \$V_{out}\$ means the potential is lower at the top of the resistor and higher at the bottom.

Now, let's say you define \$V_{out}\$ the other way:







simulate this circuit &ndash; Schematic created using CircuitLab

During the second part of the cycle, the inductor is connected to the output, and you get:

$$v_L(t) = -V_{out}$$

In the volt-seconds balance equation, this becomes:

$$DV_g - (1-D)V_{out}$$

Solving for \$V_{out}\$ now gives you:

$$V_{out} = \frac{D}{1-D}V_g$$

and if \$V_g\$ is positive, \$V_{out}\$ will be a positive number.

Both of these approaches give the same result -- the buck-boost converter inverts the input voltage. It's just a question of whether you say that in the schematic or in the number.

Why do it the way your schematic does? Because it means the output voltage is defined the same way for different kinds of converters.