Well, I was too slow writing my answer (I hate being that bad in English
)...
------------------------------------------------------------------------------
As far as I have experienced it:
At first, you choose the genre of the book you want to write (the better the writing skill, the more options you have here) like humor, drama, sci-fi or non-fiction... Then you choose the book title (the game gives you a suggestion). Yeah and after that your sim starts writing.
How many pages your book will have is determined by the type of book you're writing, for example non-fiction books have around 90, humor books around 320 - if I remember correctly. The more pages the book will have the longer the sim needs to write it. During the writing process my sim could consistently sell some chapters to a publisher and earn some (little) money that way.
When your sim is done, the whole book is sold to a publisher and your sim gets the pay: weekly royalties. And you learn, if the book is a flop, hit or best-seller. The next day your sim will find the new book in the mailbox for personal use.
I don't know if other sims can now buy these written books in the bookstore, but I can tell, that my sim read his own book in the library. :D
Hope that helps.