My dealer usually says KBB fair trade in (the lowest one, sometimes they go up to good if the car is pristine), if your selling private party probably a couple grand more.
The real price is what people will pay, so looking at what they have sold for at auction or on ebay gives you a pretty good starting point, for low mileage probably looking in the 23 range for trade and 25 range private party depending on options, maybe a bit more.
2008 335i Vert Montego/Saddle/Grey Poplar
2013 Mercedes C63 AMG Obsidian Black/Black
2016 X5 M-Sport Mineral White/Mocha Design Package/Fineline Oak