how to retrieve non-grouped contacts?
If this is a one off exercise, you can use the advanced search to select all the contacts are in any group (just keep adding all your groups to the group selection box) and create a new group "in any group". Then use the include/exclude custom search to exclude all the contacts on the "in any group" group. Then you can add them to a "not in any group" group.

Actually you could probably do it straight from include/exclude custom search.