In all cases, for all ILS approaches, both front course and (seen very seldom now) backcourse, the HSI course selector should be set to the inbound front course QDM.
At some airport locations, the ILS front course can be switched from one runway to the opposite end, the frequency being the same as well as (most times) the identifier, and in all these cases, the HSI course selector would/should be set to the inbound front course.
Having said this, for the HSI instrument to function, it does not matter at all whether you set a course or not, as with a localizer (quite unlike a VOR) it makes no difference whatsoever, however, for the presentation to appear properly to the pilot, the course selector is always set as I have indicated.