I would suggest doing this using two layers of aggregation. First create flags for each class. Then aggregate by those flags:
select has_1165, has_1174, has_1173, count(*) as cnt, min(userpid), max(userpid)
from (select userpid,
max(case when classid = 1165 then 1 else 0 end) as has_1165,
max(case when classid = 1174 then 1 else 0 end) as has_1174,
max(case when classid = 1173 then 1 else 0 end) as has_1173
from store.attendance
where classid in (1165, 1173, 1174) and
datehour between '2014-04-28 00:00:00' and '2014-04-30 00:00:00'
group by userpid
) a
group by has_1165, has_1174, has_1173;