reduce harmonics produced by microcontroller I'm generating an 18kHz sine signal using a dsPIC microcontroller at 44100kHz (I'm not sure I can call it sampling rate, maybe generation rate, although the concept is the same). 
The dsPIC's DAC then feeds an LM386 amplifier and then an 8-ohm speaker.  

Since the generation method is digital, I get harmonics (36kHz) which get aliased, and I hear the parasitic low frequency (8.1kHz) which is something I wish to get rid off.

I was told that I should put an LPF with a sharp cutoff just above 18kHz at the output of the microcontroller so that those high frequency harmonics don't get amplified, but my intuition tells me that I should put an HPF, since by the time the signal is out of the microcontroller it already contains those low frequencies and an LPF will not help.

Am I correct?
Thanks!
No, you need a low pass filter aka reconstruction filter.

In the general case your filter needs to reject everything at or above Nyquist = Fs/2 = 22.05 kHz. Typically it might have have a roll-off from say -3 dB at 20kHz to -80 dB at 22 kHz. This would be quite a demanding filter to implement with analogue components however, so if you are really only interested in generating a single tone at 18 kHz then you can use a less aggressive LPF which has a -3 dB point at say 20 kHz and a stop-band which begins at 35 kHz.