Developers can now download the beta of iPhone OS 4.0 from the Apple Developer Connection. Both the firmware and SDK are available. The SDK is build 10M2236a and the firmware is build 8A230m.
Access to iPhone SDK beta
However, You must be enrolled in the iPhone Developer Standard or Enterprise Program to access the development resources for iPhone SDK beta.
Not enrolled in the iPhone Developer Program? Learn More