I made two such beds in for my two boys (ages 5 and 3 1/2) for the room that they share. The room was barely big enough for them, their beds, dressers, toys, etc. This was what I came up with, based on a similar free standing design that I designed in college. It took about $150 and seven or eight hours for two beds, rails, and ladders. Way cheaper, and way cooler, than bunkbeds! When the rail is off and the bed is made, the cable is nearly invisible, giving a illusion of beds floating about 30" from the ceiling.
For each bed:
1) Mount two 2x4s in a corner -- one was 72" in length, the other was about 32" (the length and width of the mattress). Screw these into the wall studs using 3 1/2 inch screws.
2) Cut a piece of 3/4" plywood slightly larger than the mattress; nail it to the 2x4s from above, and secure it from below using angle braces.
3) Drill a hole in "outside" corner for a large eye bolt, fender washer, and a block of scrap wood, and a nut.
4) HERE'S THE COOL PART. Secure a 3/8" steel cable, with plastic coating, about 5 feet long, to the eye bolt using two cable clamps, and put the other end through a small hole in the ceiling.
5) Take a piece of steel pipe (Mine was left over from a plumbing home improvement job) and put it over the rafters in your attic, perpendicular to the rafters. The piece of pipe that I had was 1" pipe; I tacked it down with some little pieces that I have no idea what they are called, but look like half circles with flat parts with a screw hole. Wrap the cable around the pipe and secure it with two cable clamps.
6) the bed can be leveled by adjusting the clamps, or by turning the eye bolt. It helped to prop the bed to the exact height while I was in the attic so that I didn't need to make massive adjustments once I got back downstairs.
After the initial construction, I framed the rest of the plywood w/ 2x4s, which makes it a little stronger. My kids LOVE them. I've been up there with all three of my kids (I also have 2 year old daughter) at once (about 250 lbs total) and the bed didn't even budge an inch -- it's rock solid. The cable alone is rated for 800+ lbs.
There's more nuances to this. (How high is it off the floor? How did you make the rails? How did you make the ladders?) Reply if you want photos or more information. I'm happy to share. Good luck!
p.s. I saw this post prior to making the beds, but with no info -- I hope this helps you out!