How can I determine the value of an out of production set on the aftermarket? I have a number of early 70's or earlier LEGO sets.

One is set 40 and the other is train number 171.

I'm trying to find a value and some additional information for these sets. I have searched a little but haven't found anything substantial on the image hunt.

Both sets are with their box.
There are several sources you can use to determine the value of a set. Just remember that:

Just because it sold once for a certain amount, yours will not necessarily sell for the same amount. Tons of factors come into play, including completeness, box quality but also demand, location and luck (especially with vintage sets).
Just because it sold once before, doesn't mean the set is in demand or will sell anytime soon. Especially with very old sets like yours, there isn't a lot of demand. Vintage LEGO is nice to have, but sets from those days are significantly less sophisticated than recent sets.
For LEGO: older doesn't necessarily mean more expensive. A lot of really old sets actually sell for remarkably little money.

In no particular order, here are the most common reference sources for determining set values:
Bricklink
The most comprehensive source of set values when dealing with items that collectors will buy. Your everyday buyer won't typically use this venue, but in case of vintage sets, collectors do frequent BL. It's Price Guide feature is powerful, but only contains data on the last 6 months.
Set 40 has not been sold the last 6 months on BL, so there is no Price Guide. It does have 5 current listings world-wide.
Set 171 has also not seen any sales in the last 6 months on BL, but it currently has 17 listings world-wide.
EBay
EBay shows a history of sold listings for any given search term. Since EBay is also used by the casual shopper, this gives you a broader overview, however, especially for highly collector items that don't have a broad audience, like your vintage sets, people might shun EBay due to high fees.
Looking at set 40 sold listings on EBay, there have been 2 in the last while, both international sales in Europe.
Set 171 has been sold 3 times, two at around $50 and one at around $100 (USD).
BrickPicker
Brickpicker is an investment guide for LEGO. This site focuses on managing a portfolio of LEGO sets as if they were stocks. They keep important statistics (mainly compiled from EBay) on every set produced by the LEGO group. Sales statistics are nicely split out by country/region, which can be helpful.
Set 40 is listed here.
Set 171 is listed here. As you can see, neither of these sets have a lot of sales data due to their age and low sales frequency.
There are other sites such as camelcamelcamel.com which tracks sales of toys on Amazon.com, but the above 3 are the key ones I would use.