Проверьте это, надеюсь, это поможет
var users = new[]
{
new {UserGroupId = 1, UserId = 1, UserName = "John"},
new {UserGroupId = 1, UserId = 2, UserName = "Lisa"},
new {UserGroupId = 2, UserId = 3, UserName = "Nathan"},
new {UserGroupId = 3, UserId = 4, UserName = "Tim"}
};
var userGroups = from user in users
group user by user.UserGroupId into userGroup
select new {
UserGroupId = userGroup.Key,
Users = userGroup.ToList()
};
foreach (var group in userGroups)
{
Console.WriteLine("{0} - {1}",group.UserGroupId, group.Users.Count);
}