The easiest way to do this is to make an album into which you put all photos that you want to keep, then drag and drop them from Photos into a folder on your hard drive. After the copy has finished, right-click on the photos in the album then choose Delete (not Remove from Album as that won't delete them from the library). This will remove them from iCloud as well.
Keeping them on the iOS devices is trickier as there's no separate area to store them. You could create a shared album in Photos, copying the photos into it before deleting them from the regular album. (Shared albums are not included in your regular Photos library, so they won't be copied back to your iCloud Photo Library.) This would then make them available on the Shared tab of any iOS devices that use the same Apple ID, or any users you invite to the shared album for that matter.